<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>投票窗口页</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/base.css">
		<style>
			body {
			}
			.base_add_icon {
				height: 20px;
				position: absolute;
				top: 50%;
				right: 15px;
				margin-top: -11px;
			}
			.base_back_icon_right {
				height: 20px;
				position: absolute;
				top: 50%;
				right: 15px;
				margin-top: -11px;
			}
		</style>
	</head>
	<body>
		<div class="base_style_color" id='BarAppearance' style="height: 22px;width: 100%; position:fixed; left: 0px;top:0px;z-index: 998" ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar" style="position: fixed;left: 0px;top: 20px;">
			<a class="base_left_item" href="#" onclick="closeWin()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="title">投票</span>
			<a class="base_right_item nav-item" id="wancheng" onclick="historyClick()" style="display: none"> <img class="base_back_icon_right" src="../../image/icon_mutualrating__history.png" alt=""> </a>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/push.js"></script>
	<script type="text/javascript" src="../../script/timeStampTool.js"></script>
	<script type="text/javascript">
		apiready = function() {
			if (api.pageParam.ismocc == "history") {
				$('#wancheng').hide();
			} else {
				$('#wancheng').show();
			}
			setupSubframe();
			ReceNotifi();
		};
		//历史记录
		function historyClick() {
			api.openWin({useWKWebView:true,
				name : 'Teacher_VoteHistoryWindow',
				url : 'Teacher_VoteHistoryWindow.html',
				pageParam : {
					cid : api.pageParam.cid,
					pid : api.pageParam.pid,
					sourceurl : window.location.pathname,
					sourcetitle : document.title,
				},
			});
		}

		function setupSubframe() {
			var y = $('.base_navigation_bar').height() + 20;
			var h = api.winHeight - y;
			api.openFrame({
				name : 'Teacher_VoteScore',
				url : 'Teacher_VoteScore.html',
				rect : {
					x : 0,
					y : y,
					w : 'auto',
					h : h
				},
				pageParam : {
					iid : api.pageParam.iid,
					itemCheck : api.pageParam.itemCheck,
					ismocc : api.pageParam.ismocc,
					sourceurl : api.pageParam.sourceurl,
					sourcetitle : api.pageParam.sourcetitle,
					cid : api.pageParam.cid,
					pid : api.pageParam.pid,
					ishistory : api.pageParam.ishistory,
				},
				bounces : false,
				vScrollBarEnabled : true,
				hScrollBarEnabled : false
			});
		}

		function ReceNotifi() {
			api.addEventListener({
				name : 'closeVoteScorePopu'
			}, function(ret, err) {
				//coding...
				back();
			});
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				//coding...
				closeWin();
			});
		}

		function closeWin() {
			api.sendEvent({
				name : 'openVoteScorePopu'
			});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		function back() {
			sendBuriedNotifi('1', '老师端投票结果页', '215')
			if (!api.pageParam.ismocc) {//自由课程列表过来
				api.closeToWin({
					name : 'Teacher_StudyFreeCourseTab'
				});
			} else if (api.pageParam.ismocc == "history") {
				api.closeToWin({
					name : 'Teacher_VoteHistoryWindow'
				});
			} else {
				api.closeToWin({
					name : 'Teacher_StudyCourseMoocTab'
				});
			}
		}
	</script>
</html>
</script> </html>